package com.rdxer.sso.web.db;

import com.rdxer.db.auto.DBAutoManager;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
// 先刷新表 再做迁移
@Order(9)
public class AutoRunner implements ApplicationRunner {

    @Resource
    DBAutoManager autoManager;

    @Override
    public void run(ApplicationArguments args) {
        autoManager
                .setDbType(DBAutoManager.DbType.MySQL)
                .run();
    }
}
